package com.lwd.springcloud.billmanagement.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Author: li wenda
 * @Description:
 * @Date Created in 2021-10-22 11:39
 * @Modified By:
 */
@RestController
@RequestMapping("/config")
@RefreshScope
public class ConfigController {

    @Value("${key1}")
    private String key1;
    @Value("${key2}")
    private String key2;
    @Value("${key3}")
    private String key3;

    @GetMapping
    public Map<String, String> config() {
        return Map.of("key1", key1, "key2", key2, "key3", key3);
    }
}
